# Makefile for libcommon.a
# $Id: Makefile,v 1.3 2001/03/26 16:18:54 mvines Exp $
# 
# Copyright (C) 2001  Michael Vines
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#

EXE=common.o
SRC=log.c version.c winver.c syscall_names.c
OBJ=$(SRC:.c=.o) 
DEP=$(SRC:.c=.d)

CUSTOMCLEAN=1

include ../Rules.mk

CFLAGS += -DLOG_SOURCE=LOG_UNKNOWN

$(EXE): $(OBJ)
	$(LD) -r -o $@ $^


genver.h:
	@echo "[creating genver.h]"
	@echo /\* autogenerated \*/ > .ver
	@echo \#define LINE_COMPILE_DATE \"`date +%Y%m%e`\" >> .ver 
	@echo \#define LINE_COMPILE_TIME \"`date +%H%M%S`\" >> .ver 
	@echo \#define LINE_COMPILED_BY \"`whoami`\" >> .ver 
	@echo \#define LINE_COMPILE_HOST \"`hostname`\" >> .ver 
	@echo >> .ver
	@echo \#ifndef LINE_VERSION >> .ver
	@echo \#define LINE_VERSION \"\(build \" LINE_COMPILE_DATE LINE_COMPILE_TIME \"_\" LINE_COMPILED_BY \"@\" LINE_COMPILE_HOST \"\)\" >> .ver
	@echo \#endif >> .ver
	@mv .ver genver.h


customclean:
	rm -f genver.h
